(define (search-for-primes x)
  (define (timed-prime-test n)
    (newline)
    (display n)
    (start-prime-test n (real-time-clock)))
  (define (start-prime-test n start-time)
    (if (prime? n)
      (report-prime (- (real-time-clock) start-time))))
  (define (report-prime elapsed-time)
    (display " *** ")
    (display elapsed-time))
  (define (smallest-divisor n)
    (find-divisor n 2))
  (define (find-divisor n test-divisor)
    (cond ((> (square test-divisor) n) n)
          ((divides? test-divisor n) test-divisor)
          (else (find-divisor n (+ test-divisor 1)))))
  (define (divides? a b)
    (= (remainder b a) 0))
  (define (prime? n)
    (cond ((= n (smallest-divisor n)) #t)
          (else (prime? (next-odd n)))))
  (define (next-odd n)
    (cond ((even? n) (+ n 1))
          (else (+ n 2))))
  (timed-prime-test x))
